배송 |
---|
상품 정보 | 가격 | 삭제 |
---|---|---|
아두이노 10파이 RGB LED 모듈 | ||
TOTAL PRICE(수량) 0 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 |
void setup() {
}
void loop() {
analogWrite(9, 0); // RED를 255/255 만큼 켭니다.
analogWrite(10, 255); // BLUE를 0/255 만큼 켭니다.
analogWrite(11, 255); // GREEN를 0/255 만큼 켭니다. -> 빨강색 출력 (밝기 255)
delay(3000);
analogWrite(9, 255); // RED를 0/255 만큼 켭니다.
analogWrite(10, 0); // BLUE를 255/255 만큼 켭니다.
analogWrite(11, 255); // GREEN를 0/255 만큼 켭니다. -> 파란색 출력 (밝기 255)
delay(3000);
analogWrite(9, 255); // RED를 0/255 만큼 켭니다.
analogWrite(10, 255); // BLUE를 0/255 만큼 켭니다.
analogWrite(11, 0); // GREEN를 255/255 만큼 켭니다. -> 초록색 출력 (밝기 255)
delay(3000);
analogWrite(9, 200); // RED를 55/255 만큼 켭니다.
analogWrite(10, 200); // BLUE를 55/255 만큼 켭니다.
analogWrite(11, 200); // GREEN를 55/255 만큼 켭니다. -> 흰색 출력 (밝기 55)
delay(3000);
for(int a=0;a<255;a++){
analogWrite(9, a); // RED,BLUE,GREEN를 a/255만큼 켭니다.-> 흰색 출력, 밝기 조절
analogWrite(10, a);
analogWrite(11, a);
delay(20);
}
}
|
cs |